package org.example.manage.impl;

import org.example.manage.FirstManage;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;

import javax.annotation.Resource;

@Component
public class FirstManageImpl implements FirstManage {

    @Resource
    private Jedis jedis;
    @Override
    public void insertSet(String key, String value) {
            jedis.set(key,value);
    }

    @Override
    public String getSet(String key) {
       return jedis.get(key);
    }

    @Override
    public void insertHash(String key, String field, String value) {
                jedis.hset(key, field, value);
    }

    @Override
    public void incrHash(String key, String field) {
                    jedis.hincrBy(key,field,1);
    }

    @Override
    public void decrHash(String key, String field) {
                jedis.hincrBy(key,field,-1);

    }
}
